# Maintainer: Jelle van der Waa <jelle@archlinux.org>
# Maintainer: Daurnimator<daurnimator@archlinux.org>

pkgname=wishbone-utils
pkgver=0.7.8
pkgrel=1
pkgdesc='Utilities for working with a Wishbone bridge'
arch=(loong64 x86_64)
url="https://github.com/litex-hub/wishbone-utils"
license=(BSD)
depends=(glibc gcc-libs)
makedepends=(rust)
source=($pkgname-$pkgver.tar.gz::https://github.com/litex-hub/wishbone-utils/archive/v$pkgver.tar.gz)
sha512sums=('ca61e335f97c3e5ed0b02d71601c4d2102c87ea40051f7345514c1624c06bdaa47bb6acca66c0709968c9e39faf570f49e5ec81cb444909029498043240e506d')

build() {
  cd $pkgname-$pkgver/wishbone-tool
  cargo build --release --locked
}

check() {
  cd $pkgname-$pkgver/wishbone-tool
  cargo test --release --locked
}

package() {
  cd $pkgname-$pkgver
  install -Dm 755 wishbone-tool/target/release/wishbone-tool -t "${pkgdir}/usr/bin/"
  install -D -m644 LICENSE "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
}
